﻿using System.Web;
using System.Web.Routing;

namespace CodeContrib.Web.Routing
{
	public class GuidRouteContstraint : IRouteConstraint
	{
		public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
		{
			return (values.ContainsKey(parameterName) && values[parameterName].ToString().IsGuid());
		}
	}
}